package org.acghub.mtdb.core.log.impl;

import org.acghub.mtdb.core.LogKey;
import org.acghub.mtdb.core.log.LogAbstractCollection;
import org.acghub.mtdb.core.log.LogAbstractList;

import java.util.List;
import java.util.RandomAccess;

public final class LogArrayList<E> extends LogAbstractList<E> implements RandomAccess {

    public LogArrayList(LogKey logkey, List<E> wrapped) {
        super(logkey, wrapped);
    }

    private LogArrayList(LogAbstractCollection<E> root, List<E> wrapped) {
        super(root, wrapped);
    }

    @Override
    public List<E> subList(int fromIndex, int toIndex) {
        return new LogArrayList<>(this, wrapped().subList(fromIndex, toIndex));
    }
}
